
import { defineStore } from "pinia"
import { ref } from "vue"
export const useAuthStore = defineStore("auth", {
  state: () => ({
    token: ''
  }),
  actions: {
    
     login(tokenVal) {
      this.token = tokenVal
    },
     logout(){
      this.token = ""
    }
    
  },
  // 计算
  getters: {}
 
}, {
  persist: {
    enabled: true,
    strategies: [
      {
        key: "auth",
        storage: localStorage,
      },
    ],
  },
})
